Skip to content

Conversation

@ieedan
Copy link
Contributor

@ieedan ieedan commented Nov 19, 2025

I hope you might like this one better, I think it strikes a good balance between minimizing the config needed and the magic while also maximizing the configurability.

This proposal rotates around a function in the config file called defineComponent. This function takes in the title, category, and description and defines the files necessary for each variant.

For example:

defineComponent({
  title: 'AnimatedContent',
  category: 'Animations',
  description:
    'Wrapper that animates any children on scroll or mount with configurable direction, distance, duration and easing.'
}),

We define all our items with defineComponent in the items array and then we can build the registry with:

jsrepo build
# watch mode
jsrepo build --watch

We use the @jsrepo/shadcn package to adapt the jsrepo build output to something that the shadcn CLI can understand using the output exported from the package:

import { output } from '@jsrepo/shadcn';

// ...
{
	// ...
	outputs: [output({ dir: 'public/r', format: true })],
	// ...
}

We set dir to public/r to tell jsrepo to output the registry under public/r.

I also added 2 new commands to the package.json that will do the work of the other commands before:

  • registry:build - Builds the registry
  • registry:dev - Builds the registry in watch mode

Users

shadcn CLI users

  • No change

jsrepo users

jsrepo users will have a few options for how to add components:

# init registry
jsrepo init https://reactbits.dev/r
# list components
jsrepo add --registry https://reactbits.dev/r

# setup namespace registry using shadcn directory
jsrepo config provider @jsrepo/shadcn
# add components using shadcn provider
jsrepo add --registry shadcn:@react-bits

TODO:

  • Delete make-define-component-code.ts
  • Delete registry.json
  • Update jsrepo section of the docs
  • Untrack the registry output (optional)

@DavidHDev
Copy link
Owner

seems pretty nice, I think we can go with it. The only problem is, with this approach, I still have to manage two different files for component data, which will easily go out of sync if I'm not careful (Information.js and jsrepo.config.ts)

@ieedan
Copy link
Contributor Author

ieedan commented Nov 21, 2025

seems pretty nice, I think we can go with it. The only problem is, with this approach, I still have to manage two different files for component data, which will easily go out of sync if I'm not careful (Information.js and jsrepo.config.ts)

Ahh I didn't see this. We could also just delete this now :) Just need to move that info into the jsrepo.config before I do.

@ieedan
Copy link
Contributor Author

ieedan commented Nov 21, 2025

It's also worth mentioning that it seems like a lot of the meta data from that file is being left out of the registry currently so I can make that work as well.

@ieedan
Copy link
Contributor Author

ieedan commented Nov 21, 2025

Okay now everything will instead be based off of Information.js and you just need to make sure that stays up to date. It looks like it's missing a few components atm.

@DavidHDev
Copy link
Owner

I don't think it's missing anything, I keep that one updated with every addition/deletion, it should be the single source of truth for what's in the library

@ieedan
Copy link
Contributor Author

ieedan commented Nov 21, 2025

It looks like all that's missing right now is rolling gallery

@DavidHDev
Copy link
Owner

Yeah no, that one was completely deleted from the library, should not exist anymore

@ieedan
Copy link
Contributor Author

ieedan commented Nov 21, 2025

Oh perfect then :)

@ieedan ieedan changed the title WIP: jsrepo v3 proposal v3 jsrepo v3 Nov 24, 2025
@ieedan ieedan marked this pull request as ready for review November 24, 2025 16:20
@ieedan
Copy link
Contributor Author

ieedan commented Nov 24, 2025

@DavidHDev jsrepo v3 is now out I just updated the installation instructions so this should be good to go!

@DavidHDev
Copy link
Owner

Alright! Awesome, let's merge this and see if anything blows up! 😰

@DavidHDev DavidHDev merged commit e6ccf84 into DavidHDev:main Nov 24, 2025
@ieedan ieedan deleted the jsrepo-v3-again branch November 24, 2025 16:29
@ieedan
Copy link
Contributor Author

ieedan commented Nov 24, 2025

Just ping me if anything does I should be available

@DavidHDev
Copy link
Owner

well, something did blow up:

2025-11-24T16:28:05.683Z	Initializing build environment...
2025-11-24T16:28:07.619Z	Success: Finished initializing build environment
2025-11-24T16:28:08.078Z	Cloning repository...
2025-11-24T16:28:14.017Z	Detected the following tools from environment: [email protected], [email protected]
2025-11-24T16:28:14.241Z	Installing project dependencies: npm clean-install --progress=false
2025-11-24T16:28:17.469Z	npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
2025-11-24T16:28:17.960Z	npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
2025-11-24T16:28:18.129Z	npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
2025-11-24T16:28:19.815Z	npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead
2025-11-24T16:28:19.954Z	npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead
2025-11-24T16:28:21.939Z	npm warn deprecated [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
2025-11-24T16:28:28.414Z	
2025-11-24T16:28:28.414Z	added 598 packages, and audited 599 packages in 14s
2025-11-24T16:28:28.414Z	
2025-11-24T16:28:28.414Z	154 packages are looking for funding
2025-11-24T16:28:28.414Z	  run `npm fund` for details
2025-11-24T16:28:28.423Z	
2025-11-24T16:28:28.423Z	10 vulnerabilities (2 low, 7 moderate, 1 high)
2025-11-24T16:28:28.423Z	
2025-11-24T16:28:28.423Z	To address issues that do not require attention, run:
2025-11-24T16:28:28.424Z	  npm audit fix
2025-11-24T16:28:28.424Z	
2025-11-24T16:28:28.424Z	To address all issues (including breaking changes), run:
2025-11-24T16:28:28.424Z	  npm audit fix --force
2025-11-24T16:28:28.424Z	
2025-11-24T16:28:28.424Z	Run `npm audit` for details.
2025-11-24T16:28:28.718Z	Executing user build command: npm run build
2025-11-24T16:28:28.940Z	
2025-11-24T16:28:28.940Z	> [email protected] build
2025-11-24T16:28:28.941Z	> npm run registry:build && npm run llms:text && vite build
2025-11-24T16:28:28.941Z	
2025-11-24T16:28:29.080Z	
2025-11-24T16:28:29.081Z	> [email protected] registry:build
2025-11-24T16:28:29.081Z	> jsrepo build
2025-11-24T16:28:29.081Z	
2025-11-24T16:28:29.457Z	┌   jsrepo  v3.0.0 
2025-11-24T16:28:29.897Z	│
2025-11-24T16:28:29.897Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/content/Components/Lanyard/card.glb.
2025-11-24T16:28:29.898Z	│
2025-11-24T16:28:29.898Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/content/Components/Lanyard/lanyard.png.
2025-11-24T16:28:29.939Z	│
2025-11-24T16:28:29.939Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/tailwind/Components/Lanyard/card.glb.
2025-11-24T16:28:29.940Z	│
2025-11-24T16:28:29.940Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/tailwind/Components/Lanyard/lanyard.png.
2025-11-24T16:28:29.979Z	│
2025-11-24T16:28:29.979Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/ts-default/Components/Lanyard/card.glb.
2025-11-24T16:28:29.979Z	│
2025-11-24T16:28:29.979Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/ts-default/Components/Lanyard/lanyard.png.
2025-11-24T16:28:30.030Z	│
2025-11-24T16:28:30.030Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/ts-tailwind/Components/Lanyard/card.glb.
2025-11-24T16:28:30.030Z	│
2025-11-24T16:28:30.031Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/ts-tailwind/Components/Lanyard/lanyard.png.
2025-11-24T16:28:30.473Z	│
2025-11-24T16:28:30.473Z	└  Finished in 1015.31ms
2025-11-24T16:28:30.473Z	   @react-bits: Created 1 output in 1015.02ms with 462 items and 462 files.
2025-11-24T16:28:30.473Z	
2025-11-24T16:28:30.703Z	
2025-11-24T16:28:30.706Z	> [email protected] llms:text
2025-11-24T16:28:30.711Z	> node ./scripts/generateLlmsText.js
2025-11-24T16:28:30.711Z	
2025-11-24T16:28:30.751Z	registry.json not found - run `npm run shadcn:generate` first.
2025-11-24T16:28:30.779Z	Failed: error occurred while running build command
2025-11-24T16:28:05.683Z	Initializing build environment...
2025-11-24T16:28:07.619Z	Success: Finished initializing build environment
2025-11-24T16:28:08.078Z	Cloning repository...
2025-11-24T16:28:14.017Z	Detected the following tools from environment: [email protected], [email protected]
2025-11-24T16:28:14.241Z	Installing project dependencies: npm clean-install --progress=false
2025-11-24T16:28:17.469Z	npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
2025-11-24T16:28:17.960Z	npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
2025-11-24T16:28:18.129Z	npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
2025-11-24T16:28:19.815Z	npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead
2025-11-24T16:28:19.954Z	npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead
2025-11-24T16:28:21.939Z	npm warn deprecated [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
2025-11-24T16:28:28.414Z	
2025-11-24T16:28:28.414Z	added 598 packages, and audited 599 packages in 14s
2025-11-24T16:28:28.414Z	
2025-11-24T16:28:28.414Z	154 packages are looking for funding
2025-11-24T16:28:28.414Z	  run `npm fund` for details
2025-11-24T16:28:28.423Z	
2025-11-24T16:28:28.423Z	10 vulnerabilities (2 low, 7 moderate, 1 high)
2025-11-24T16:28:28.423Z	
2025-11-24T16:28:28.423Z	To address issues that do not require attention, run:
2025-11-24T16:28:28.424Z	  npm audit fix
2025-11-24T16:28:28.424Z	
2025-11-24T16:28:28.424Z	To address all issues (including breaking changes), run:
2025-11-24T16:28:28.424Z	  npm audit fix --force
2025-11-24T16:28:28.424Z	
2025-11-24T16:28:28.424Z	Run `npm audit` for details.
2025-11-24T16:28:28.718Z	Executing user build command: npm run build
2025-11-24T16:28:28.940Z	
2025-11-24T16:28:28.940Z	> [email protected] build
2025-11-24T16:28:28.941Z	> npm run registry:build && npm run llms:text && vite build
2025-11-24T16:28:28.941Z	
2025-11-24T16:28:29.080Z	
2025-11-24T16:28:29.081Z	> [email protected] registry:build
2025-11-24T16:28:29.081Z	> jsrepo build
2025-11-24T16:28:29.081Z	
2025-11-24T16:28:29.457Z	┌   jsrepo  v3.0.0 
2025-11-24T16:28:29.897Z	│
2025-11-24T16:28:29.897Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/content/Components/Lanyard/card.glb.
2025-11-24T16:28:29.898Z	│
2025-11-24T16:28:29.898Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/content/Components/Lanyard/lanyard.png.
2025-11-24T16:28:29.939Z	│
2025-11-24T16:28:29.939Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/tailwind/Components/Lanyard/card.glb.
2025-11-24T16:28:29.940Z	│
2025-11-24T16:28:29.940Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/tailwind/Components/Lanyard/lanyard.png.
2025-11-24T16:28:29.979Z	│
2025-11-24T16:28:29.979Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/ts-default/Components/Lanyard/card.glb.
2025-11-24T16:28:29.979Z	│
2025-11-24T16:28:29.979Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/ts-default/Components/Lanyard/lanyard.png.
2025-11-24T16:28:30.030Z	│
2025-11-24T16:28:30.030Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/ts-tailwind/Components/Lanyard/card.glb.
2025-11-24T16:28:30.030Z	│
2025-11-24T16:28:30.031Z	▲  Couldn't find a language to resolve dependencies for /opt/buildhome/repo/src/ts-tailwind/Components/Lanyard/lanyard.png.
2025-11-24T16:28:30.473Z	│
2025-11-24T16:28:30.473Z	└  Finished in 1015.31ms
2025-11-24T16:28:30.473Z	   @react-bits: Created 1 output in 1015.02ms with 462 items and 462 files.
2025-11-24T16:28:30.473Z	
2025-11-24T16:28:30.703Z	
2025-11-24T16:28:30.706Z	> [email protected] llms:text
2025-11-24T16:28:30.711Z	> node ./scripts/generateLlmsText.js
2025-11-24T16:28:30.711Z	
2025-11-24T16:28:30.751Z	registry.json not found - run `npm run shadcn:generate` first.
2025-11-24T16:28:30.779Z	Failed: error occurred while running build command

@ieedan
Copy link
Contributor Author

ieedan commented Nov 24, 2025

Whoops! Let me take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants